<?php
defined('BY_JYA') or exit('error');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$return=array();

if($_RQ['op']=='get'){
	$return['item']=uni_setting('agent');
	$return['htmls']=array (
		  'type' => 'edit',
		  'post' => 'post',
		  'edit_tab' => '代理商收款设置',
		  'edits' => 
		  array (
		    0 => 
		    array (
		      'title' => '代理商收款设置',
		      'list' => 
		      array (
		        0 => 
		        array (
		          'name' => 'pay_type',
		          'type' => 'radio',
		          'title' => '收款方式',
				  'options'=>'pay_type'
		        ),
		        1 => 
		        array (
		          'name' => 'pay_name',
		          'type' => 'string',
		          'title' => '收款人姓名',
		        ),
		        2 => 
		        array (
		          'name' => 'pay_card',
		          'type' => 'string',
		          'title' => '收款账号',
		        ),
		        3 => 
		        array (
		          'name' => 'pay_bank',
		          'type' => 'string',
		          'title' => '收款银行',
				  'show'=>array('pay_type'=>'3')
		        ),
		      ),
		    ),
		  ),
		);
	$return['pay_type']=array (1 => '支付宝支付',2 => '微信支付',3=>'银联支付');
	exi($return);
}
if($_RQ['op']=='post'){
	$postdata=get_postdata();
	$postdata=array_fields(array('pay_bank','pay_type','pay_name','pay_card'),$postdata);
	uni_setting('agent',$postdata);
	exi('设置成功！');
}
?>